{% extends "users/space/base.html" %}

{% block title %}
	个人空间
{% endblock %}

{% block space-external %}
{% endblock %}

{% block space-main %}
	<div class="user-space-content-box">
		{% if mixed %}
			<h4 class="text-center">TA的动态</h4>
			<hr/>
			{% for dynamic in mixed %}
				{% if dynamic.class_name == 'DepartmentPost' %}
					<div class="user-space-content-box-body-box">
						<h4><a href="{% url 'departments:department_post_info' dynamic.id %}" target="_blank">{{ dynamic.title }}</a></h4>
						<div class="row" style="margin-bottom: 10px;">
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-globe"></span><span>{{ dynamic.department.name }}</span>
							</div>
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-calendar"></span><span>{{ dynamic.created_time|date:'Y-m-d' }}</span>
							</div>
						</div>
						<p>{{ dynamic.desc }}</p>
					</div>
				{% elif dynamic.class_name == 'AssociationPost' %}
					<div class="user-space-content-box-body-box">
						<h4><a href="{% url 'departments:association_post_info' dynamic.id %}" target="_blank">{{ dynamic.title }}</a></h4>
						<div class="row" style="margin-bottom: 10px;">
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-globe"></span><span>{{ dynamic.association.name }}</span>
							</div>
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-calendar"></span><span>{{ dynamic.created_time|date:'Y-m-d' }}</span>
							</div>
						</div>
						<p>{{ dynamic.desc }}</p>
					</div>
				{% else %}
					<div class="user-space-content-box-body-box">
						<h4><a href="{% url 'communications:postDetail' dynamic.id %}" target="_blank">{{ dynamic.title }}</a></h4>
						<div class="row">
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-calendar"></span><span>{{ dynamic.created_time|date:'Y-m-d' }}</span>
							</div>
							<div class="col-sm-6">
								<span class="glyphicon glyphicon-th-list"></span><span>{{ dynamic.category }}</span>
							</div>
						</div>
					</div>
				{% endif %}
			{% endfor %}
		{% else %}
			<div class="alert alert-warning">该用户暂无最近动态</div>
		{% endif %}
	</div>
{% endblock %}